<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>papyros.distributed</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >papyros documentation</th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="papyros-module.html">Package&nbsp;papyros</a> ::
        Module&nbsp;distributed
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="papyros.distributed-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="papyros.distributed-module.html">Module papyros.distributed</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-docstring">'''A distributed process implementation of the papyros API.</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-docstring">Both the L{TaskDispatcher} and each L{Worker} is a separate process, running on</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-docstring">one or more interconnected machines.</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-docstring">@requires: U{Pyro 3.7 &lt;http://pyro.sourceforge.net/&gt;}.</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-docstring">'''</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-name">__all__</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line">    <tt class="py-string">'NonRemoteMethodError'</tt><tt class="py-op">,</tt> <tt class="py-string">'set_nameserver'</tt><tt class="py-op">,</tt> <tt class="py-string">'PyroTaskDispatcher'</tt><tt class="py-op">,</tt> <tt class="py-string">'PyroWorker'</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-op">]</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">os</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">time</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">socket</tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">traceback</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">Pyro</tt><tt class="py-op">,</tt> <tt class="py-name">Pyro</tt><tt class="py-op">.</tt><tt class="py-name">core</tt><tt class="py-op">,</tt> <tt class="py-name">Pyro</tt><tt class="py-op">.</tt><tt class="py-name">naming</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">Pyro</tt><tt class="py-op">.</tt><tt class="py-name">errors</tt> <tt class="py-keyword">import</tt> <tt class="py-name">NamingError</tt><tt class="py-op">,</tt> <tt class="py-name">ConnectionClosedError</tt><tt class="py-op">,</tt> <tt class="py-name">ProtocolError</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Package papyros=papyros-module.html"><a title="papyros" class="py-name" href="#" onclick="return doclink('link-0', 'papyros', 'link-0');">papyros</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Variable papyros.log=papyros-module.html#log"><a title="papyros.log" class="py-name" href="#" onclick="return doclink('link-1', 'log', 'link-1');">log</a></tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-2" class="py-name"><a title="papyros" class="py-name" href="#" onclick="return doclink('link-2', 'papyros', 'link-0');">papyros</a></tt><tt class="py-op">.</tt><tt id="link-3" class="py-name" targets="Module papyros.base=papyros.base-module.html"><a title="papyros.base" class="py-name" href="#" onclick="return doclink('link-3', 'base', 'link-3');">base</a></tt> <tt class="py-keyword">import</tt> <tt id="link-4" class="py-name" targets="Class papyros.base.TaskDispatcher=papyros.base.TaskDispatcher-class.html"><a title="papyros.base.TaskDispatcher" class="py-name" href="#" onclick="return doclink('link-4', 'TaskDispatcher', 'link-4');">TaskDispatcher</a></tt><tt class="py-op">,</tt> <tt id="link-5" class="py-name" targets="Class papyros.base.TaskQueue=papyros.base.TaskQueue-class.html"><a title="papyros.base.TaskQueue" class="py-name" href="#" onclick="return doclink('link-5', 'TaskQueue', 'link-5');">TaskQueue</a></tt><tt class="py-op">,</tt> <tt id="link-6" class="py-name" targets="Class papyros.base.Worker=papyros.base.Worker-class.html"><a title="papyros.base.Worker" class="py-name" href="#" onclick="return doclink('link-6', 'Worker', 'link-6');">Worker</a></tt><tt class="py-op">,</tt> <tt id="link-7" class="py-name" targets="Class papyros.base.ClosedTaskDispatcherError=papyros.base.ClosedTaskDispatcherError-class.html"><a title="papyros.base.ClosedTaskDispatcherError" class="py-name" href="#" onclick="return doclink('link-7', 'ClosedTaskDispatcherError', 'link-7');">ClosedTaskDispatcherError</a></tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt id="link-8" class="py-name" targets="Variable papyros.distributed.PYRO_DAEMON=papyros.distributed-module.html#PYRO_DAEMON"><a title="papyros.distributed.PYRO_DAEMON" class="py-name" href="#" onclick="return doclink('link-8', 'PYRO_DAEMON', 'link-8');">PYRO_DAEMON</a></tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"><tt id="link-9" class="py-name" targets="Variable papyros.distributed.ROOT_GROUP=papyros.distributed-module.html#ROOT_GROUP"><a title="papyros.distributed.ROOT_GROUP" class="py-name" href="#" onclick="return doclink('link-9', 'ROOT_GROUP', 'link-9');">ROOT_GROUP</a></tt> <tt class="py-op">=</tt> <tt class="py-string">':Papyros'</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line"><tt id="link-10" class="py-name" targets="Variable papyros.distributed.NAME_SERVER_LOCATOR=papyros.distributed-module.html#NAME_SERVER_LOCATOR"><a title="papyros.distributed.NAME_SERVER_LOCATOR" class="py-name" href="#" onclick="return doclink('link-10', 'NAME_SERVER_LOCATOR', 'link-10');">NAME_SERVER_LOCATOR</a></tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"> </tt>
<a name="NonRemoteMethodError"></a><div id="NonRemoteMethodError-def"><a name="L29"></a><tt class="py-lineno"> 29</tt> <a class="py-toggle" href="#" id="NonRemoteMethodError-toggle" onclick="return toggle('NonRemoteMethodError');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="papyros.distributed.NonRemoteMethodError-class.html">NonRemoteMethodError</a><tt class="py-op">(</tt><tt class="py-base-class">Exception</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="NonRemoteMethodError-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="NonRemoteMethodError-expanded"><a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line">    <tt class="py-docstring">'''Tried to call remotely a method allowed to be called locally only.'''</tt> </tt>
</div><a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"> </tt>
<a name="set_nameserver"></a><div id="set_nameserver-def"><a name="L32"></a><tt class="py-lineno"> 32</tt> <a class="py-toggle" href="#" id="set_nameserver-toggle" onclick="return toggle('set_nameserver');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed-module.html#set_nameserver">set_nameserver</a><tt class="py-op">(</tt><tt class="py-param">host</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">port</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="set_nameserver-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="set_nameserver-expanded"><a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line">    <tt class="py-docstring">'''Specify the Pyro NameServer address.</tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"><tt class="py-docstring">    If this function is not called, the NameServer is attempted to be discovered</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"><tt class="py-docstring">    automatically by a broadcast lookup.</tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line"><tt class="py-docstring">    @param host: The hostname that is initially tried to find the NameServer on,</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line"><tt class="py-docstring">        or when the broadcast lookup mechanism fails.</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"><tt class="py-docstring">    @param port: The socket number on which the Name Server will listen for</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"><tt class="py-docstring">        incoming requests.</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">host</tt><tt class="py-op">:</tt> <tt class="py-name">Pyro</tt><tt class="py-op">.</tt><tt class="py-name">config</tt><tt class="py-op">.</tt><tt class="py-name">PYRO_NS_HOSTNAME</tt> <tt class="py-op">=</tt> <tt class="py-name">host</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">port</tt><tt class="py-op">:</tt> <tt class="py-name">Pyro</tt><tt class="py-op">.</tt><tt class="py-name">config</tt><tt class="py-op">.</tt><tt class="py-name">PYRO_NS_PORT</tt> <tt class="py-op">=</tt> <tt class="py-name">port</tt> </tt>
</div><a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line"> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line"><tt class="py-comment">#========== PyroTaskDispatcher =================================================</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="PyroTaskDispatcher"></a><div id="PyroTaskDispatcher-def"><a name="L48"></a><tt class="py-lineno"> 48</tt> <a class="py-toggle" href="#" id="PyroTaskDispatcher-toggle" onclick="return toggle('PyroTaskDispatcher');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="papyros.distributed.PyroTaskDispatcher-class.html">PyroTaskDispatcher</a><tt class="py-op">(</tt><tt class="py-base-class">TaskDispatcher</tt><tt class="py-op">,</tt> <tt class="py-base-class">Pyro</tt><tt class="py-op">.</tt><tt class="py-base-class">core</tt><tt class="py-op">.</tt><tt class="py-base-class">ObjBase</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroTaskDispatcher-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="PyroTaskDispatcher-expanded"><a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">    <tt class="py-docstring">'''A L{TaskDispatcher} run as a (potentially remote) process.'''</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line"> </tt>
<a name="PyroTaskDispatcher.__init__"></a><div id="PyroTaskDispatcher.__init__-def"><a name="L51"></a><tt class="py-lineno"> 51</tt> <a class="py-toggle" href="#" id="PyroTaskDispatcher.__init__-toggle" onclick="return toggle('PyroTaskDispatcher.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed.PyroTaskDispatcher-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">size</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-param">group</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroTaskDispatcher.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="PyroTaskDispatcher.__init__-expanded"><a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line">        <tt class="py-docstring">'''Initialize this dispatcher.</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line"><tt class="py-docstring">        @param size: See L{TaskDispatcher.__init__}.</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line"><tt class="py-docstring">        @param group: The identifier of this dispatcher's distributed group.</tt> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">        <tt id="link-11" class="py-name" targets="Function papyros.distributed.init_pyro()=papyros.distributed-module.html#init_pyro"><a title="papyros.distributed.init_pyro" class="py-name" href="#" onclick="return doclink('link-11', 'init_pyro', 'link-11');">init_pyro</a></tt><tt class="py-op">(</tt><tt class="py-name">server</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">        <tt id="link-12" class="py-name"><a title="papyros.base.TaskDispatcher" class="py-name" href="#" onclick="return doclink('link-12', 'TaskDispatcher', 'link-4');">TaskDispatcher</a></tt><tt class="py-op">.</tt><tt id="link-13" class="py-name" targets="Method papyros.base.TaskDispatcher.__init__()=papyros.base.TaskDispatcher-class.html#__init__,Method papyros.base.TaskQueue.__init__()=papyros.base.TaskQueue-class.html#__init__,Method papyros.base.Worker.__init__()=papyros.base.Worker-class.html#__init__,Method papyros.distributed.PyroTaskDispatcher.__init__()=papyros.distributed.PyroTaskDispatcher-class.html#__init__,Method papyros.distributed.PyroTaskQueue.__init__()=papyros.distributed.PyroTaskQueue-class.html#__init__,Method papyros.distributed.PyroWorker.__init__()=papyros.distributed.PyroWorker-class.html#__init__,Method papyros.dummy.DummyTaskDispatcher.__init__()=papyros.dummy.DummyTaskDispatcher-class.html#__init__,Method papyros.execute.CompositeExecutionDecorator.__init__()=papyros.execute.CompositeExecutionDecorator-class.html#__init__,Method papyros.execute.DefaultTaskExecutioner.__init__()=papyros.execute.DefaultTaskExecutioner-class.html#__init__,Method papyros.execute.ExecuteIterator.__init__()=papyros.execute.ExecuteIterator-class.html#__init__,Method papyros.execute.OrderedExecutionDecorator.__init__()=papyros.execute.OrderedExecutionDecorator-class.html#__init__,Method papyros.execute.TaskExecutionDecorator.__init__()=papyros.execute.TaskExecutionDecorator-class.html#__init__,Method papyros.multithreaded.MultiThreadedTaskDispatcher.__init__()=papyros.multithreaded.MultiThreadedTaskDispatcher-class.html#__init__,Method papyros.multithreaded.MultiThreadedWorker.__init__()=papyros.multithreaded.MultiThreadedWorker-class.html#__init__,Method papyros.task.Task.__init__()=papyros.task.Task-class.html#__init__"><a title="papyros.base.TaskDispatcher.__init__
papyros.base.TaskQueue.__init__
papyros.base.Worker.__init__
papyros.distributed.PyroTaskDispatcher.__init__
papyros.distributed.PyroTaskQueue.__init__
papyros.distributed.PyroWorker.__init__
papyros.dummy.DummyTaskDispatcher.__init__
papyros.execute.CompositeExecutionDecorator.__init__
papyros.execute.DefaultTaskExecutioner.__init__
papyros.execute.ExecuteIterator.__init__
papyros.execute.OrderedExecutionDecorator.__init__
papyros.execute.TaskExecutionDecorator.__init__
papyros.multithreaded.MultiThreadedTaskDispatcher.__init__
papyros.multithreaded.MultiThreadedWorker.__init__
papyros.task.Task.__init__" class="py-name" href="#" onclick="return doclink('link-13', '__init__', 'link-13');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">size</tt><tt class="py-op">)</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">        <tt class="py-name">Pyro</tt><tt class="py-op">.</tt><tt class="py-name">core</tt><tt class="py-op">.</tt><tt class="py-name">ObjBase</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name"><a title="papyros.base.TaskDispatcher.__init__
papyros.base.TaskQueue.__init__
papyros.base.Worker.__init__
papyros.distributed.PyroTaskDispatcher.__init__
papyros.distributed.PyroTaskQueue.__init__
papyros.distributed.PyroWorker.__init__
papyros.dummy.DummyTaskDispatcher.__init__
papyros.execute.CompositeExecutionDecorator.__init__
papyros.execute.DefaultTaskExecutioner.__init__
papyros.execute.ExecuteIterator.__init__
papyros.execute.OrderedExecutionDecorator.__init__
papyros.execute.TaskExecutionDecorator.__init__
papyros.multithreaded.MultiThreadedTaskDispatcher.__init__
papyros.multithreaded.MultiThreadedWorker.__init__
papyros.task.Task.__init__" class="py-name" href="#" onclick="return doclink('link-14', '__init__', 'link-13');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__name</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Class Method papyros.distributed.PyroTaskDispatcher._get_name()=papyros.distributed.PyroTaskDispatcher-class.html#_get_name,Class Method papyros.distributed.PyroWorker._get_name()=papyros.distributed.PyroWorker-class.html#_get_name"><a title="papyros.distributed.PyroTaskDispatcher._get_name
papyros.distributed.PyroWorker._get_name" class="py-name" href="#" onclick="return doclink('link-15', '_get_name', 'link-15');">_get_name</a></tt><tt class="py-op">(</tt><tt class="py-name">group</tt><tt class="py-op">)</tt> </tt>
</div><a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line"> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line">    <tt class="py-decorator">@</tt><tt class="py-decorator">classmethod</tt> </tt>
<a name="PyroTaskDispatcher.get_proxy"></a><div id="PyroTaskDispatcher.get_proxy-def"><a name="L63"></a><tt class="py-lineno"> 63</tt> <a class="py-toggle" href="#" id="PyroTaskDispatcher.get_proxy-toggle" onclick="return toggle('PyroTaskDispatcher.get_proxy');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed.PyroTaskDispatcher-class.html#get_proxy">get_proxy</a><tt class="py-op">(</tt><tt class="py-param">cls</tt><tt class="py-op">,</tt> <tt class="py-param">group</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroTaskDispatcher.get_proxy-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="PyroTaskDispatcher.get_proxy-expanded"><a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line">        <tt class="py-docstring">'''Get a proxy object to a running L{PyroTaskDispatcher}.</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line"><tt class="py-docstring">        @param group: The identifier of the dispatcher's distributed group.</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">        <tt id="link-16" class="py-name"><a title="papyros.distributed.init_pyro" class="py-name" href="#" onclick="return doclink('link-16', 'init_pyro', 'link-11');">init_pyro</a></tt><tt class="py-op">(</tt><tt class="py-name">server</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">        <tt class="py-name">proxy</tt> <tt class="py-op">=</tt> <tt id="link-17" class="py-name"><a title="papyros.distributed.NAME_SERVER_LOCATOR" class="py-name" href="#" onclick="return doclink('link-17', 'NAME_SERVER_LOCATOR', 'link-10');">NAME_SERVER_LOCATOR</a></tt><tt class="py-op">.</tt><tt class="py-name">getNS</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">resolve</tt><tt class="py-op">(</tt><tt class="py-name">cls</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="papyros.distributed.PyroTaskDispatcher._get_name
papyros.distributed.PyroWorker._get_name" class="py-name" href="#" onclick="return doclink('link-18', '_get_name', 'link-15');">_get_name</a></tt><tt class="py-op">(</tt><tt class="py-name">group</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">getProxy</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">        <tt class="py-name">proxy</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt> <tt class="py-op">=</tt> <tt id="link-19" class="py-name" targets="Class papyros.distributed.PyroTaskDispatcherProxy=papyros.distributed.PyroTaskDispatcherProxy-class.html"><a title="papyros.distributed.PyroTaskDispatcherProxy" class="py-name" href="#" onclick="return doclink('link-19', 'PyroTaskDispatcherProxy', 'link-19');">PyroTaskDispatcherProxy</a></tt> <tt class="py-comment"># XXX HACK</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">proxy</tt> </tt>
</div><a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line"> </tt>
<a name="PyroTaskDispatcher.run"></a><div id="PyroTaskDispatcher.run-def"><a name="L73"></a><tt class="py-lineno"> 73</tt> <a class="py-toggle" href="#" id="PyroTaskDispatcher.run-toggle" onclick="return toggle('PyroTaskDispatcher.run');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed.PyroTaskDispatcher-class.html#run">run</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroTaskDispatcher.run-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="PyroTaskDispatcher.run-expanded"><a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line">        <tt class="py-docstring">'''Start the event loop of this dispatcher.'''</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line">        <tt class="py-name">uri</tt> <tt class="py-op">=</tt> <tt id="link-20" class="py-name" targets="Function papyros.distributed.register()=papyros.distributed-module.html#register"><a title="papyros.distributed.register" class="py-name" href="#" onclick="return doclink('link-20', 'register', 'link-20');">register</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__name</tt><tt class="py-op">,</tt> <tt class="py-name">force</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line">        <tt id="link-21" class="py-name"><a title="papyros.log" class="py-name" href="#" onclick="return doclink('link-21', 'log', 'link-1');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">info</tt><tt class="py-op">(</tt><tt class="py-string">'%s is now registered (%s)'</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">uri</tt><tt class="py-op">)</tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line">            <tt class="py-keyword">try</tt><tt class="py-op">:</tt> <tt id="link-22" class="py-name"><a title="papyros.distributed.PYRO_DAEMON" class="py-name" href="#" onclick="return doclink('link-22', 'PYRO_DAEMON', 'link-8');">PYRO_DAEMON</a></tt><tt class="py-op">.</tt><tt class="py-name">requestLoop</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">            <tt class="py-keyword">except</tt> <tt class="py-name">KeyboardInterrupt</tt><tt class="py-op">:</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line">                <tt id="link-23" class="py-name"><a title="papyros.log" class="py-name" href="#" onclick="return doclink('link-23', 'log', 'link-1');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">info</tt><tt class="py-op">(</tt><tt class="py-string">'%s exiting gracefully'</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line">        <tt class="py-keyword">finally</tt><tt class="py-op">:</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line">            <tt id="link-24" class="py-name"><a title="papyros.distributed.PYRO_DAEMON" class="py-name" href="#" onclick="return doclink('link-24', 'PYRO_DAEMON', 'link-8');">PYRO_DAEMON</a></tt><tt class="py-op">.</tt><tt id="link-25" class="py-name" targets="Method papyros.base.Worker.disconnect()=papyros.base.Worker-class.html#disconnect"><a title="papyros.base.Worker.disconnect" class="py-name" href="#" onclick="return doclink('link-25', 'disconnect', 'link-25');">disconnect</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line">            <tt id="link-26" class="py-name"><a title="papyros.distributed.PYRO_DAEMON" class="py-name" href="#" onclick="return doclink('link-26', 'PYRO_DAEMON', 'link-8');">PYRO_DAEMON</a></tt><tt class="py-op">.</tt><tt class="py-name">shutdown</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line"> </tt>
<a name="PyroTaskDispatcher.__str__"></a><div id="PyroTaskDispatcher.__str__-def"><a name="L85"></a><tt class="py-lineno"> 85</tt> <a class="py-toggle" href="#" id="PyroTaskDispatcher.__str__-toggle" onclick="return toggle('PyroTaskDispatcher.__str__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed.PyroTaskDispatcher-class.html#__str__">__str__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroTaskDispatcher.__str__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="PyroTaskDispatcher.__str__-expanded"><a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__name</tt> </tt>
</div><a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line"> </tt>
<a name="PyroTaskDispatcher._make_queue"></a><div id="PyroTaskDispatcher._make_queue-def"><a name="L88"></a><tt class="py-lineno"> 88</tt> <a class="py-toggle" href="#" id="PyroTaskDispatcher._make_queue-toggle" onclick="return toggle('PyroTaskDispatcher._make_queue');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed.PyroTaskDispatcher-class.html#_make_queue">_make_queue</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">size</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroTaskDispatcher._make_queue-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="PyroTaskDispatcher._make_queue-expanded"><a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-27" class="py-name" targets="Class papyros.distributed.PyroTaskQueue=papyros.distributed.PyroTaskQueue-class.html"><a title="papyros.distributed.PyroTaskQueue" class="py-name" href="#" onclick="return doclink('link-27', 'PyroTaskQueue', 'link-27');">PyroTaskQueue</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt><tt class="py-name">size</tt><tt class="py-op">)</tt> </tt>
</div><a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line"> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line">    <tt class="py-decorator">@</tt><tt class="py-decorator">classmethod</tt> </tt>
<a name="PyroTaskDispatcher._get_name"></a><div id="PyroTaskDispatcher._get_name-def"><a name="L92"></a><tt class="py-lineno"> 92</tt> <a class="py-toggle" href="#" id="PyroTaskDispatcher._get_name-toggle" onclick="return toggle('PyroTaskDispatcher._get_name');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed.PyroTaskDispatcher-class.html#_get_name">_get_name</a><tt class="py-op">(</tt><tt class="py-param">cls</tt><tt class="py-op">,</tt> <tt class="py-param">group</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroTaskDispatcher._get_name-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="PyroTaskDispatcher._get_name-expanded"><a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">        <tt class="py-docstring">'''Return the full name of a L{PyroTaskDispatcher}.</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line"><tt class="py-docstring">        @param group: The identifier of the dispatcher's distributed group.</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">        <tt class="py-name">parts</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt id="link-28" class="py-name"><a title="papyros.distributed.ROOT_GROUP" class="py-name" href="#" onclick="return doclink('link-28', 'ROOT_GROUP', 'link-9');">ROOT_GROUP</a></tt><tt class="py-op">,</tt> <tt class="py-string">'Dispatcher'</tt><tt class="py-op">]</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">group</tt><tt class="py-op">:</tt> <tt class="py-name">parts</tt><tt class="py-op">.</tt><tt class="py-name">insert</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">group</tt><tt class="py-op">)</tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-string">'.'</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">parts</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line"> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line"> </tt>
<a name="PyroTaskDispatcherProxy"></a><div id="PyroTaskDispatcherProxy-def"><a name="L102"></a><tt class="py-lineno">102</tt> <a class="py-toggle" href="#" id="PyroTaskDispatcherProxy-toggle" onclick="return toggle('PyroTaskDispatcherProxy');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="papyros.distributed.PyroTaskDispatcherProxy-class.html">PyroTaskDispatcherProxy</a><tt class="py-op">(</tt><tt class="py-base-class">Pyro</tt><tt class="py-op">.</tt><tt class="py-base-class">core</tt><tt class="py-op">.</tt><tt class="py-base-class">DynamicProxy</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroTaskDispatcherProxy-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="PyroTaskDispatcherProxy-expanded"><a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">    <tt class="py-docstring">'''A proxy class of L{PyroTaskDispatcher}.</tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line"><tt class="py-docstring">    Clients interact with instances of this class instead of actual</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line"><tt class="py-docstring">    L{PyroTaskDispatcher} instances. The differences are that L{execute} is</tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line"><tt class="py-docstring">    invoked locally on the client and that L{close} and L{run} are not</tt> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line"><tt class="py-docstring">    accesible remotely.</tt> </tt>
<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">    <tt id="link-29" class="py-name" targets="Method papyros.base.TaskDispatcher.execute()=papyros.base.TaskDispatcher-class.html#execute,Module papyros.execute=papyros.execute-module.html,Method papyros.task.Task.execute()=papyros.task.Task-class.html#execute"><a title="papyros.base.TaskDispatcher.execute
papyros.execute
papyros.task.Task.execute" class="py-name" href="#" onclick="return doclink('link-29', 'execute', 'link-29');">execute</a></tt> <tt class="py-op">=</tt> <tt id="link-30" class="py-name" targets="Class papyros.distributed.PyroTaskDispatcher=papyros.distributed.PyroTaskDispatcher-class.html"><a title="papyros.distributed.PyroTaskDispatcher" class="py-name" href="#" onclick="return doclink('link-30', 'PyroTaskDispatcher', 'link-30');">PyroTaskDispatcher</a></tt><tt class="py-op">.</tt><tt id="link-31" class="py-name"><a title="papyros.base.TaskDispatcher.execute
papyros.execute
papyros.task.Task.execute" class="py-name" href="#" onclick="return doclink('link-31', 'execute', 'link-29');">execute</a></tt><tt class="py-op">.</tt><tt class="py-name">im_func</tt> </tt>
<a name="PyroTaskDispatcherProxy.run"></a><div id="PyroTaskDispatcherProxy.run-def"><a name="L111"></a><tt class="py-lineno">111</tt> <a class="py-toggle" href="#" id="PyroTaskDispatcherProxy.run-toggle" onclick="return toggle('PyroTaskDispatcherProxy.run');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed.PyroTaskDispatcherProxy-class.html#run">run</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-keyword">raise</tt> <tt id="link-32" class="py-name" targets="Class papyros.distributed.NonRemoteMethodError=papyros.distributed.NonRemoteMethodError-class.html"><a title="papyros.distributed.NonRemoteMethodError" class="py-name" href="#" onclick="return doclink('link-32', 'NonRemoteMethodError', 'link-32');">NonRemoteMethodError</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="PyroTaskDispatcherProxy.close"></a><div id="PyroTaskDispatcherProxy.close-def"><a name="L112"></a><tt class="py-lineno">112</tt> <a class="py-toggle" href="#" id="PyroTaskDispatcherProxy.close-toggle" onclick="return toggle('PyroTaskDispatcherProxy.close');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed.PyroTaskDispatcherProxy-class.html#close">close</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-keyword">raise</tt> <tt id="link-33" class="py-name"><a title="papyros.distributed.NonRemoteMethodError" class="py-name" href="#" onclick="return doclink('link-33', 'NonRemoteMethodError', 'link-32');">NonRemoteMethodError</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line"> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line"><tt class="py-comment">#========== PyroTaskQueue ======================================================</tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="PyroTaskQueue"></a><div id="PyroTaskQueue-def"><a name="L116"></a><tt class="py-lineno">116</tt> <a class="py-toggle" href="#" id="PyroTaskQueue-toggle" onclick="return toggle('PyroTaskQueue');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="papyros.distributed.PyroTaskQueue-class.html">PyroTaskQueue</a><tt class="py-op">(</tt><tt class="py-base-class">TaskQueue</tt><tt class="py-op">,</tt> <tt class="py-base-class">Pyro</tt><tt class="py-op">.</tt><tt class="py-base-class">core</tt><tt class="py-op">.</tt><tt class="py-base-class">ObjBase</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroTaskQueue-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="PyroTaskQueue-expanded"><a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">    <tt class="py-docstring">'''A L{TaskQueue} used for distributed execution.'''</tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line"> </tt>
<a name="PyroTaskQueue.__init__"></a><div id="PyroTaskQueue.__init__-def"><a name="L119"></a><tt class="py-lineno">119</tt> <a class="py-toggle" href="#" id="PyroTaskQueue.__init__-toggle" onclick="return toggle('PyroTaskQueue.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed.PyroTaskQueue-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">dispatcher</tt><tt class="py-op">,</tt> <tt class="py-param">size</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroTaskQueue.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="PyroTaskQueue.__init__-expanded"><a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">        <tt id="link-34" class="py-name"><a title="papyros.distributed.init_pyro" class="py-name" href="#" onclick="return doclink('link-34', 'init_pyro', 'link-11');">init_pyro</a></tt><tt class="py-op">(</tt><tt class="py-name">server</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line">        <tt id="link-35" class="py-name"><a title="papyros.base.TaskQueue" class="py-name" href="#" onclick="return doclink('link-35', 'TaskQueue', 'link-5');">TaskQueue</a></tt><tt class="py-op">.</tt><tt id="link-36" class="py-name"><a title="papyros.base.TaskDispatcher.__init__
papyros.base.TaskQueue.__init__
papyros.base.Worker.__init__
papyros.distributed.PyroTaskDispatcher.__init__
papyros.distributed.PyroTaskQueue.__init__
papyros.distributed.PyroWorker.__init__
papyros.dummy.DummyTaskDispatcher.__init__
papyros.execute.CompositeExecutionDecorator.__init__
papyros.execute.DefaultTaskExecutioner.__init__
papyros.execute.ExecuteIterator.__init__
papyros.execute.OrderedExecutionDecorator.__init__
papyros.execute.TaskExecutionDecorator.__init__
papyros.multithreaded.MultiThreadedTaskDispatcher.__init__
papyros.multithreaded.MultiThreadedWorker.__init__
papyros.task.Task.__init__" class="py-name" href="#" onclick="return doclink('link-36', '__init__', 'link-13');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">dispatcher</tt><tt class="py-op">,</tt> <tt class="py-name">size</tt><tt class="py-op">)</tt> </tt>
<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line">        <tt class="py-name">Pyro</tt><tt class="py-op">.</tt><tt class="py-name">core</tt><tt class="py-op">.</tt><tt class="py-name">ObjBase</tt><tt class="py-op">.</tt><tt id="link-37" class="py-name"><a title="papyros.base.TaskDispatcher.__init__
papyros.base.TaskQueue.__init__
papyros.base.Worker.__init__
papyros.distributed.PyroTaskDispatcher.__init__
papyros.distributed.PyroTaskQueue.__init__
papyros.distributed.PyroWorker.__init__
papyros.dummy.DummyTaskDispatcher.__init__
papyros.execute.CompositeExecutionDecorator.__init__
papyros.execute.DefaultTaskExecutioner.__init__
papyros.execute.ExecuteIterator.__init__
papyros.execute.OrderedExecutionDecorator.__init__
papyros.execute.TaskExecutionDecorator.__init__
papyros.multithreaded.MultiThreadedTaskDispatcher.__init__
papyros.multithreaded.MultiThreadedWorker.__init__
papyros.task.Task.__init__" class="py-name" href="#" onclick="return doclink('link-37', '__init__', 'link-13');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">        <tt id="link-38" class="py-name"><a title="papyros.distributed.PYRO_DAEMON" class="py-name" href="#" onclick="return doclink('link-38', 'PYRO_DAEMON', 'link-8');">PYRO_DAEMON</a></tt><tt class="py-op">.</tt><tt id="link-39" class="py-name" targets="Method papyros.base.Worker.connect()=papyros.base.Worker-class.html#connect"><a title="papyros.base.Worker.connect" class="py-name" href="#" onclick="return doclink('link-39', 'connect', 'link-39');">connect</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
</div><a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line"> </tt>
<a name="PyroTaskQueue.close"></a><div id="PyroTaskQueue.close-def"><a name="L125"></a><tt class="py-lineno">125</tt> <a class="py-toggle" href="#" id="PyroTaskQueue.close-toggle" onclick="return toggle('PyroTaskQueue.close');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed.PyroTaskQueue-class.html#close">close</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroTaskQueue.close-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="PyroTaskQueue.close-expanded"><a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> <tt id="link-40" class="py-name"><a title="papyros.base.TaskQueue" class="py-name" href="#" onclick="return doclink('link-40', 'TaskQueue', 'link-5');">TaskQueue</a></tt><tt class="py-op">.</tt><tt id="link-41" class="py-name" targets="Method papyros.base.TaskDispatcher.close()=papyros.base.TaskDispatcher-class.html#close,Method papyros.base.TaskQueue.close()=papyros.base.TaskQueue-class.html#close,Method papyros.distributed.PyroTaskDispatcherProxy.close()=papyros.distributed.PyroTaskDispatcherProxy-class.html#close,Method papyros.distributed.PyroTaskQueue.close()=papyros.distributed.PyroTaskQueue-class.html#close,Method papyros.distributed.PyroTaskQueueProxy.close()=papyros.distributed.PyroTaskQueueProxy-class.html#close,Method papyros.execute.DefaultTaskExecutioner.close()=papyros.execute.DefaultTaskExecutioner-class.html#close,Method papyros.execute.ExecuteIterator.close()=papyros.execute.ExecuteIterator-class.html#close,Method papyros.execute.TaskExecutionDecorator.close()=papyros.execute.TaskExecutionDecorator-class.html#close,Method papyros.execute.TaskExecutioner.close()=papyros.execute.TaskExecutioner-class.html#close"><a title="papyros.base.TaskDispatcher.close
papyros.base.TaskQueue.close
papyros.distributed.PyroTaskDispatcherProxy.close
papyros.distributed.PyroTaskQueue.close
papyros.distributed.PyroTaskQueueProxy.close
papyros.execute.DefaultTaskExecutioner.close
papyros.execute.ExecuteIterator.close
papyros.execute.TaskExecutionDecorator.close
papyros.execute.TaskExecutioner.close" class="py-name" href="#" onclick="return doclink('link-41', 'close', 'link-41');">close</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line">        <tt class="py-keyword">finally</tt><tt class="py-op">:</tt> <tt id="link-42" class="py-name"><a title="papyros.distributed.PYRO_DAEMON" class="py-name" href="#" onclick="return doclink('link-42', 'PYRO_DAEMON', 'link-8');">PYRO_DAEMON</a></tt><tt class="py-op">.</tt><tt id="link-43" class="py-name"><a title="papyros.base.Worker.disconnect" class="py-name" href="#" onclick="return doclink('link-43', 'disconnect', 'link-25');">disconnect</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
</div><a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line"> </tt>
<a name="PyroTaskQueue._get_proxy"></a><div id="PyroTaskQueue._get_proxy-def"><a name="L129"></a><tt class="py-lineno">129</tt> <a class="py-toggle" href="#" id="PyroTaskQueue._get_proxy-toggle" onclick="return toggle('PyroTaskQueue._get_proxy');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed.PyroTaskQueue-class.html#_get_proxy">_get_proxy</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroTaskQueue._get_proxy-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="PyroTaskQueue._get_proxy-expanded"><a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line">        <tt class="py-docstring">'''Return a proxy to this queue as it is to be known by its dispatcher.'''</tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line">        <tt class="py-name">proxy</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">getProxy</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line">        <tt class="py-name">proxy</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt> <tt class="py-op">=</tt> <tt id="link-44" class="py-name" targets="Class papyros.distributed.PyroTaskQueueProxy=papyros.distributed.PyroTaskQueueProxy-class.html"><a title="papyros.distributed.PyroTaskQueueProxy" class="py-name" href="#" onclick="return doclink('link-44', 'PyroTaskQueueProxy', 'link-44');">PyroTaskQueueProxy</a></tt> <tt class="py-comment"># XXX HACK</tt> </tt>
<a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">proxy</tt> </tt>
</div></div><a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line"> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line"> </tt>
<a name="PyroTaskQueueProxy"></a><div id="PyroTaskQueueProxy-def"><a name="L136"></a><tt class="py-lineno">136</tt> <a class="py-toggle" href="#" id="PyroTaskQueueProxy-toggle" onclick="return toggle('PyroTaskQueueProxy');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="papyros.distributed.PyroTaskQueueProxy-class.html">PyroTaskQueueProxy</a><tt class="py-op">(</tt><tt class="py-base-class">Pyro</tt><tt class="py-op">.</tt><tt class="py-base-class">core</tt><tt class="py-op">.</tt><tt class="py-base-class">DynamicProxy</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroTaskQueueProxy-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="PyroTaskQueueProxy-expanded"><a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line">    <tt class="py-docstring">'''A proxy class of L{PyroTaskQueue}.</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line"><tt class="py-docstring">    The only difference is that Pyro exceptions on remote calls to L{close} are</tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line"><tt class="py-docstring">    silently ignored.</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
<a name="PyroTaskQueueProxy.close"></a><div id="PyroTaskQueueProxy.close-def"><a name="L142"></a><tt class="py-lineno">142</tt> <a class="py-toggle" href="#" id="PyroTaskQueueProxy.close-toggle" onclick="return toggle('PyroTaskQueueProxy.close');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed.PyroTaskQueueProxy-class.html#close">close</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroTaskQueueProxy.close-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="PyroTaskQueueProxy.close-expanded"><a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__getattr__</tt><tt class="py-op">(</tt><tt class="py-string">'close'</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-op">(</tt><tt class="py-name">ProtocolError</tt><tt class="py-op">,</tt> <tt class="py-name">ConnectionClosedError</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-keyword">pass</tt> </tt>
</div></div><a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line"> </tt>
<a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line"><tt class="py-comment">#========== PyroWorker =========================================================</tt> </tt>
<a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="PyroWorker"></a><div id="PyroWorker-def"><a name="L148"></a><tt class="py-lineno">148</tt> <a class="py-toggle" href="#" id="PyroWorker-toggle" onclick="return toggle('PyroWorker');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="papyros.distributed.PyroWorker-class.html">PyroWorker</a><tt class="py-op">(</tt><tt class="py-base-class">Worker</tt><tt class="py-op">,</tt> <tt class="py-base-class">Pyro</tt><tt class="py-op">.</tt><tt class="py-base-class">core</tt><tt class="py-op">.</tt><tt class="py-base-class">ObjBase</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroWorker-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="PyroWorker-expanded"><a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line">    <tt class="py-docstring">'''A L{Worker} run as a (potentially remote) process.'''</tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line"> </tt>
<a name="PyroWorker.__init__"></a><div id="PyroWorker.__init__-def"><a name="L151"></a><tt class="py-lineno">151</tt> <a class="py-toggle" href="#" id="PyroWorker.__init__-toggle" onclick="return toggle('PyroWorker.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed.PyroWorker-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">group</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroWorker.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="PyroWorker.__init__-expanded"><a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line">        <tt class="py-docstring">'''Initialize this worker.</tt> </tt>
<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line"><tt class="py-docstring">        @param group: The identifier of this worker's distributed group.</tt> </tt>
<a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line">        <tt id="link-45" class="py-name"><a title="papyros.base.Worker" class="py-name" href="#" onclick="return doclink('link-45', 'Worker', 'link-6');">Worker</a></tt><tt class="py-op">.</tt><tt id="link-46" class="py-name"><a title="papyros.base.TaskDispatcher.__init__
papyros.base.TaskQueue.__init__
papyros.base.Worker.__init__
papyros.distributed.PyroTaskDispatcher.__init__
papyros.distributed.PyroTaskQueue.__init__
papyros.distributed.PyroWorker.__init__
papyros.dummy.DummyTaskDispatcher.__init__
papyros.execute.CompositeExecutionDecorator.__init__
papyros.execute.DefaultTaskExecutioner.__init__
papyros.execute.ExecuteIterator.__init__
papyros.execute.OrderedExecutionDecorator.__init__
papyros.execute.TaskExecutionDecorator.__init__
papyros.multithreaded.MultiThreadedTaskDispatcher.__init__
papyros.multithreaded.MultiThreadedWorker.__init__
papyros.task.Task.__init__" class="py-name" href="#" onclick="return doclink('link-46', '__init__', 'link-13');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line">        <tt class="py-name">Pyro</tt><tt class="py-op">.</tt><tt class="py-name">core</tt><tt class="py-op">.</tt><tt class="py-name">ObjBase</tt><tt class="py-op">.</tt><tt id="link-47" class="py-name"><a title="papyros.base.TaskDispatcher.__init__
papyros.base.TaskQueue.__init__
papyros.base.Worker.__init__
papyros.distributed.PyroTaskDispatcher.__init__
papyros.distributed.PyroTaskQueue.__init__
papyros.distributed.PyroWorker.__init__
papyros.dummy.DummyTaskDispatcher.__init__
papyros.execute.CompositeExecutionDecorator.__init__
papyros.execute.DefaultTaskExecutioner.__init__
papyros.execute.ExecuteIterator.__init__
papyros.execute.OrderedExecutionDecorator.__init__
papyros.execute.TaskExecutionDecorator.__init__
papyros.multithreaded.MultiThreadedTaskDispatcher.__init__
papyros.multithreaded.MultiThreadedWorker.__init__
papyros.task.Task.__init__" class="py-name" href="#" onclick="return doclink('link-47', '__init__', 'link-13');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__group</tt> <tt class="py-op">=</tt> <tt class="py-name">group</tt> </tt>
<a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__name</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-48" class="py-name"><a title="papyros.distributed.PyroTaskDispatcher._get_name
papyros.distributed.PyroWorker._get_name" class="py-name" href="#" onclick="return doclink('link-48', '_get_name', 'link-15');">_get_name</a></tt><tt class="py-op">(</tt><tt class="py-name">group</tt><tt class="py-op">)</tt> </tt>
</div><a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line"> </tt>
<a name="PyroWorker.__str__"></a><div id="PyroWorker.__str__-def"><a name="L161"></a><tt class="py-lineno">161</tt> <a class="py-toggle" href="#" id="PyroWorker.__str__-toggle" onclick="return toggle('PyroWorker.__str__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed.PyroWorker-class.html#__str__">__str__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroWorker.__str__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="PyroWorker.__str__-expanded"><a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__name</tt> </tt>
</div><a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line"> </tt>
<a name="PyroWorker.run"></a><div id="PyroWorker.run-def"><a name="L164"></a><tt class="py-lineno">164</tt> <a class="py-toggle" href="#" id="PyroWorker.run-toggle" onclick="return toggle('PyroWorker.run');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed.PyroWorker-class.html#run">run</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">timeout</tt><tt class="py-op">=</tt><tt class="py-number">10.0</tt><tt class="py-op">,</tt> <tt class="py-param">tracebacks</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroWorker.run-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="PyroWorker.run-expanded"><a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line">        <tt class="py-docstring">'''Connect this worker to the dispatcher of its group and keep executing</tt> </tt>
<a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line"><tt class="py-docstring">        available tasks forever.</tt> </tt>
<a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line">        <tt id="link-49" class="py-name"><a title="papyros.distributed.init_pyro" class="py-name" href="#" onclick="return doclink('link-49', 'init_pyro', 'link-11');">init_pyro</a></tt><tt class="py-op">(</tt><tt class="py-name">server</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
<a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line">        <tt class="py-name">name</tt> <tt class="py-op">=</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line">        <tt class="py-name">dispatcher_name</tt> <tt class="py-op">=</tt> <tt id="link-50" class="py-name"><a title="papyros.distributed.PyroTaskDispatcher" class="py-name" href="#" onclick="return doclink('link-50', 'PyroTaskDispatcher', 'link-30');">PyroTaskDispatcher</a></tt><tt class="py-op">.</tt><tt id="link-51" class="py-name"><a title="papyros.distributed.PyroTaskDispatcher._get_name
papyros.distributed.PyroWorker._get_name" class="py-name" href="#" onclick="return doclink('link-51', '_get_name', 'link-15');">_get_name</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__group</tt><tt class="py-op">)</tt> </tt>
<a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line">        <tt class="py-name">uri</tt> <tt class="py-op">=</tt> <tt id="link-52" class="py-name"><a title="papyros.distributed.register" class="py-name" href="#" onclick="return doclink('link-52', 'register', 'link-20');">register</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">force</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
<a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line">        <tt id="link-53" class="py-name"><a title="papyros.log" class="py-name" href="#" onclick="return doclink('link-53', 'log', 'link-1');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">info</tt><tt class="py-op">(</tt><tt class="py-string">'%s is now registered (%s)'</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">uri</tt><tt class="py-op">)</tt> </tt>
<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> </tt>
<a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line">            <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-54" class="py-name" targets="Method papyros.base.Worker.is_connected()=papyros.base.Worker-class.html#is_connected"><a title="papyros.base.Worker.is_connected" class="py-name" href="#" onclick="return doclink('link-54', 'is_connected', 'link-54');">is_connected</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line">                    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-55" class="py-name"><a title="papyros.base.Worker.connect" class="py-name" href="#" onclick="return doclink('link-55', 'connect', 'link-39');">connect</a></tt><tt class="py-op">(</tt><tt id="link-56" class="py-name"><a title="papyros.distributed.PyroTaskDispatcher" class="py-name" href="#" onclick="return doclink('link-56', 'PyroTaskDispatcher', 'link-30');">PyroTaskDispatcher</a></tt><tt class="py-op">.</tt><tt id="link-57" class="py-name" targets="Class Method papyros.distributed.PyroTaskDispatcher.get_proxy()=papyros.distributed.PyroTaskDispatcher-class.html#get_proxy,Function papyros.execute.get_proxy()=papyros.execute-module.html#get_proxy"><a title="papyros.distributed.PyroTaskDispatcher.get_proxy
papyros.execute.get_proxy" class="py-name" href="#" onclick="return doclink('link-57', 'get_proxy', 'link-57');">get_proxy</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__group</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line">                    <tt id="link-58" class="py-name"><a title="papyros.log" class="py-name" href="#" onclick="return doclink('link-58', 'log', 'link-1');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">info</tt><tt class="py-op">(</tt><tt class="py-string">'%s connected to %s'</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">dispatcher_name</tt><tt class="py-op">)</tt> </tt>
<a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-59" class="py-name" targets="Method papyros.base.Worker.execute_task()=papyros.base.Worker-class.html#execute_task"><a title="papyros.base.Worker.execute_task" class="py-name" href="#" onclick="return doclink('link-59', 'execute_task', 'link-59');">execute_task</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line">                    <tt class="py-name">time</tt><tt class="py-op">.</tt><tt class="py-name">sleep</tt><tt class="py-op">(</tt><tt class="py-name">timeout</tt><tt class="py-op">)</tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line">            <tt class="py-keyword">except</tt> <tt class="py-name">KeyboardInterrupt</tt><tt class="py-op">:</tt> </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line">                <tt id="link-60" class="py-name"><a title="papyros.log" class="py-name" href="#" onclick="return doclink('link-60', 'log', 'link-1');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">info</tt><tt class="py-op">(</tt><tt class="py-string">'%s exiting gracefully'</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">)</tt> </tt>
<a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line">                <tt class="py-keyword">break</tt> </tt>
<a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line">            <tt class="py-keyword">except</tt> <tt class="py-name">Exception</tt><tt class="py-op">,</tt> <tt class="py-name">ex</tt><tt class="py-op">:</tt> </tt>
<a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">tracebacks</tt><tt class="py-op">:</tt> </tt>
<a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line">                    <tt id="link-61" class="py-name"><a title="papyros.log" class="py-name" href="#" onclick="return doclink('link-61', 'log', 'link-1');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">(</tt><tt class="py-name">traceback</tt><tt class="py-op">.</tt><tt class="py-name">format_exc</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line">                <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line">                    <tt id="link-62" class="py-name"><a title="papyros.log" class="py-name" href="#" onclick="return doclink('link-62', 'log', 'link-1');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">traceback</tt><tt class="py-op">.</tt><tt class="py-name">format_exception_only</tt><tt class="py-op">(</tt><tt class="py-name">ex</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">,</tt><tt class="py-name">ex</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-63" class="py-name"><a title="papyros.base.Worker.is_connected" class="py-name" href="#" onclick="return doclink('link-63', 'is_connected', 'link-54');">is_connected</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line">                    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-64" class="py-name"><a title="papyros.base.Worker.disconnect" class="py-name" href="#" onclick="return doclink('link-64', 'disconnect', 'link-25');">disconnect</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line">                    <tt id="link-65" class="py-name"><a title="papyros.log" class="py-name" href="#" onclick="return doclink('link-65', 'log', 'link-1');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">info</tt><tt class="py-op">(</tt><tt class="py-string">'%s disconnected from %s'</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">dispatcher_name</tt><tt class="py-op">)</tt> </tt>
<a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line">                <tt class="py-name">time</tt><tt class="py-op">.</tt><tt class="py-name">sleep</tt><tt class="py-op">(</tt><tt class="py-name">timeout</tt><tt class="py-op">)</tt> </tt>
<a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line">        <tt id="link-66" class="py-name"><a title="papyros.distributed.PYRO_DAEMON" class="py-name" href="#" onclick="return doclink('link-66', 'PYRO_DAEMON', 'link-8');">PYRO_DAEMON</a></tt><tt class="py-op">.</tt><tt id="link-67" class="py-name"><a title="papyros.base.Worker.disconnect" class="py-name" href="#" onclick="return doclink('link-67', 'disconnect', 'link-25');">disconnect</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
</div><a name="L193"></a><tt class="py-lineno">193</tt>  <tt class="py-line"> </tt>
<a name="L194"></a><tt class="py-lineno">194</tt>  <tt class="py-line">    <tt class="py-decorator">@</tt><tt class="py-decorator">classmethod</tt> </tt>
<a name="PyroWorker._get_name"></a><div id="PyroWorker._get_name-def"><a name="L195"></a><tt class="py-lineno">195</tt> <a class="py-toggle" href="#" id="PyroWorker._get_name-toggle" onclick="return toggle('PyroWorker._get_name');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed.PyroWorker-class.html#_get_name">_get_name</a><tt class="py-op">(</tt><tt class="py-param">cls</tt><tt class="py-op">,</tt> <tt class="py-param">group</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyroWorker._get_name-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="PyroWorker._get_name-expanded"><a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line">        <tt class="py-docstring">'''Return the full name of a L{PyroWorker}.</tt> </tt>
<a name="L197"></a><tt class="py-lineno">197</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line"><tt class="py-docstring">        @param group: The identifier of the workers's distributed group.</tt> </tt>
<a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L200"></a><tt class="py-lineno">200</tt>  <tt class="py-line">        <tt class="py-name">parts</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt id="link-68" class="py-name"><a title="papyros.distributed.ROOT_GROUP" class="py-name" href="#" onclick="return doclink('link-68', 'ROOT_GROUP', 'link-9');">ROOT_GROUP</a></tt><tt class="py-op">,</tt> <tt class="py-string">'Worker'</tt><tt class="py-op">,</tt> <tt class="py-string">'%s.%d'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">socket</tt><tt class="py-op">.</tt><tt class="py-name">gethostname</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">getpid</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<a name="L201"></a><tt class="py-lineno">201</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">group</tt><tt class="py-op">:</tt> <tt class="py-name">parts</tt><tt class="py-op">.</tt><tt class="py-name">insert</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">group</tt><tt class="py-op">)</tt> </tt>
<a name="L202"></a><tt class="py-lineno">202</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-string">'.'</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">parts</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L203"></a><tt class="py-lineno">203</tt>  <tt class="py-line"> </tt>
<a name="L204"></a><tt class="py-lineno">204</tt>  <tt class="py-line"><tt class="py-comment">#========== module privates ====================================================</tt> </tt>
<a name="L205"></a><tt class="py-lineno">205</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="register"></a><div id="register-def"><a name="L206"></a><tt class="py-lineno">206</tt> <a class="py-toggle" href="#" id="register-toggle" onclick="return toggle('register');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed-module.html#register">register</a><tt class="py-op">(</tt><tt class="py-param">obj</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">,</tt> <tt class="py-param">force</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="register-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="register-expanded"><a name="L207"></a><tt class="py-lineno">207</tt>  <tt class="py-line">    <tt class="py-docstring">'''Register C{obj} to the C{PYRO_DAEMON} with the given C{name}.</tt> </tt>
<a name="L208"></a><tt class="py-lineno">208</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L209"></a><tt class="py-lineno">209</tt>  <tt class="py-line"><tt class="py-docstring">    @param obj: An C{ObjBase} instance.</tt> </tt>
<a name="L210"></a><tt class="py-lineno">210</tt>  <tt class="py-line"><tt class="py-docstring">    @param name: The fully qualified object's name. If it is a dotted name (e.g.</tt> </tt>
<a name="L211"></a><tt class="py-lineno">211</tt>  <tt class="py-line"><tt class="py-docstring">        'my.object.name' it creates all necessary intermedieate nameserver</tt> </tt>
<a name="L212"></a><tt class="py-lineno">212</tt>  <tt class="py-line"><tt class="py-docstring">        groups ('my', 'my.object').</tt> </tt>
<a name="L213"></a><tt class="py-lineno">213</tt>  <tt class="py-line"><tt class="py-docstring">    @param force: If False and there is already an entry for the given name,</tt> </tt>
<a name="L214"></a><tt class="py-lineno">214</tt>  <tt class="py-line"><tt class="py-docstring">        C{NamingError} is raised. If True, the previous object is unregistered</tt> </tt>
<a name="L215"></a><tt class="py-lineno">215</tt>  <tt class="py-line"><tt class="py-docstring">        and C{obj} is registered in its place.</tt> </tt>
<a name="L216"></a><tt class="py-lineno">216</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
<a name="L217"></a><tt class="py-lineno">217</tt>  <tt class="py-line">    <tt class="py-name">nameserver</tt> <tt class="py-op">=</tt> <tt id="link-69" class="py-name"><a title="papyros.distributed.NAME_SERVER_LOCATOR" class="py-name" href="#" onclick="return doclink('link-69', 'NAME_SERVER_LOCATOR', 'link-10');">NAME_SERVER_LOCATOR</a></tt><tt class="py-op">.</tt><tt class="py-name">getNS</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L218"></a><tt class="py-lineno">218</tt>  <tt class="py-line">    <tt class="py-name">parts</tt> <tt class="py-op">=</tt> <tt class="py-name">name</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'.'</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L219"></a><tt class="py-lineno">219</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">parts</tt><tt class="py-op">:</tt> </tt>
<a name="L220"></a><tt class="py-lineno">220</tt>  <tt class="py-line">        <tt class="py-name">group</tt> <tt class="py-op">=</tt> <tt class="py-name">parts</tt><tt class="py-op">.</tt><tt id="link-70" class="py-name" targets="Method papyros.base.TaskQueue.pop()=papyros.base.TaskQueue-class.html#pop"><a title="papyros.base.TaskQueue.pop" class="py-name" href="#" onclick="return doclink('link-70', 'pop', 'link-70');">pop</a></tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L221"></a><tt class="py-lineno">221</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> </tt>
<a name="L222"></a><tt class="py-lineno">222</tt>  <tt class="py-line">            <tt class="py-keyword">try</tt><tt class="py-op">:</tt> <tt class="py-name">nameserver</tt><tt class="py-op">.</tt><tt class="py-name">createGroup</tt><tt class="py-op">(</tt><tt class="py-name">group</tt><tt class="py-op">)</tt> </tt>
<a name="L223"></a><tt class="py-lineno">223</tt>  <tt class="py-line">            <tt class="py-keyword">except</tt> <tt class="py-name">NamingError</tt><tt class="py-op">:</tt> <tt class="py-keyword">pass</tt> </tt>
<a name="L224"></a><tt class="py-lineno">224</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">parts</tt><tt class="py-op">:</tt> </tt>
<a name="L225"></a><tt class="py-lineno">225</tt>  <tt class="py-line">                <tt class="py-keyword">break</tt> </tt>
<a name="L226"></a><tt class="py-lineno">226</tt>  <tt class="py-line">            <tt class="py-name">group</tt> <tt class="py-op">+=</tt> <tt class="py-string">'.%s'</tt> <tt class="py-op">%</tt> <tt class="py-name">parts</tt><tt class="py-op">.</tt><tt id="link-71" class="py-name"><a title="papyros.base.TaskQueue.pop" class="py-name" href="#" onclick="return doclink('link-71', 'pop', 'link-70');">pop</a></tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L227"></a><tt class="py-lineno">227</tt>  <tt class="py-line">    <tt class="py-comment"># unregister previous object with this name (if any)</tt> </tt>
<a name="L228"></a><tt class="py-lineno">228</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-keyword">try</tt><tt class="py-op">:</tt> <tt class="py-name">nameserver</tt><tt class="py-op">.</tt><tt class="py-name">resolve</tt><tt class="py-op">(</tt><tt class="py-name">name</tt><tt class="py-op">)</tt> </tt>
<a name="L229"></a><tt class="py-lineno">229</tt>  <tt class="py-line">    <tt class="py-keyword">except</tt> <tt class="py-name">NamingError</tt><tt class="py-op">:</tt> <tt class="py-keyword">pass</tt> </tt>
<a name="L230"></a><tt class="py-lineno">230</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L231"></a><tt class="py-lineno">231</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">force</tt><tt class="py-op">:</tt> </tt>
<a name="L232"></a><tt class="py-lineno">232</tt>  <tt class="py-line">            <tt class="py-name">nameserver</tt><tt class="py-op">.</tt><tt class="py-name">unregister</tt><tt class="py-op">(</tt><tt class="py-name">name</tt><tt class="py-op">)</tt> </tt>
<a name="L233"></a><tt class="py-lineno">233</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L234"></a><tt class="py-lineno">234</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">NamingError</tt><tt class="py-op">(</tt><tt class="py-string">'Name %s is already registered'</tt> <tt class="py-op">%</tt> <tt class="py-name">name</tt><tt class="py-op">)</tt> </tt>
<a name="L235"></a><tt class="py-lineno">235</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-72" class="py-name"><a title="papyros.distributed.PYRO_DAEMON" class="py-name" href="#" onclick="return doclink('link-72', 'PYRO_DAEMON', 'link-8');">PYRO_DAEMON</a></tt><tt class="py-op">.</tt><tt id="link-73" class="py-name"><a title="papyros.base.Worker.connect" class="py-name" href="#" onclick="return doclink('link-73', 'connect', 'link-39');">connect</a></tt><tt class="py-op">(</tt><tt class="py-name">obj</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">)</tt> </tt>
</div><a name="L236"></a><tt class="py-lineno">236</tt>  <tt class="py-line"> </tt>
<a name="init_pyro"></a><div id="init_pyro-def"><a name="L237"></a><tt class="py-lineno">237</tt> <a class="py-toggle" href="#" id="init_pyro-toggle" onclick="return toggle('init_pyro');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="papyros.distributed-module.html#init_pyro">init_pyro</a><tt class="py-op">(</tt><tt class="py-param">server</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="init_pyro-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="init_pyro-expanded"><a name="L238"></a><tt class="py-lineno">238</tt>  <tt class="py-line">    <tt class="py-docstring">'''Ensure Pyro is initialized (or initialize it if not).</tt> </tt>
<a name="L239"></a><tt class="py-lineno">239</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L240"></a><tt class="py-lineno">240</tt>  <tt class="py-line"><tt class="py-docstring">    @param server: If True, initialize Pyro as a server, otherwise as a client.</tt> </tt>
<a name="L241"></a><tt class="py-lineno">241</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
<a name="L242"></a><tt class="py-lineno">242</tt>  <tt class="py-line">    <tt class="py-keyword">global</tt> <tt id="link-74" class="py-name"><a title="papyros.distributed.PYRO_DAEMON" class="py-name" href="#" onclick="return doclink('link-74', 'PYRO_DAEMON', 'link-8');">PYRO_DAEMON</a></tt><tt class="py-op">,</tt> <tt id="link-75" class="py-name"><a title="papyros.distributed.NAME_SERVER_LOCATOR" class="py-name" href="#" onclick="return doclink('link-75', 'NAME_SERVER_LOCATOR', 'link-10');">NAME_SERVER_LOCATOR</a></tt> </tt>
<a name="L243"></a><tt class="py-lineno">243</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-76" class="py-name"><a title="papyros.distributed.PYRO_DAEMON" class="py-name" href="#" onclick="return doclink('link-76', 'PYRO_DAEMON', 'link-8');">PYRO_DAEMON</a></tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L244"></a><tt class="py-lineno">244</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-name">server</tt> <tt class="py-keyword">and</tt> <tt class="py-name">Pyro</tt><tt class="py-op">.</tt><tt class="py-name">core</tt><tt class="py-op">.</tt><tt class="py-name">initServer</tt> <tt class="py-keyword">or</tt> <tt class="py-name">Pyro</tt><tt class="py-op">.</tt><tt class="py-name">core</tt><tt class="py-op">.</tt><tt class="py-name">initClient</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-name">banner</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
<a name="L245"></a><tt class="py-lineno">245</tt>  <tt class="py-line">        <tt id="link-77" class="py-name"><a title="papyros.distributed.PYRO_DAEMON" class="py-name" href="#" onclick="return doclink('link-77', 'PYRO_DAEMON', 'link-8');">PYRO_DAEMON</a></tt> <tt class="py-op">=</tt> <tt class="py-name">Pyro</tt><tt class="py-op">.</tt><tt class="py-name">core</tt><tt class="py-op">.</tt><tt class="py-name">Daemon</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L246"></a><tt class="py-lineno">246</tt>  <tt class="py-line">        <tt id="link-78" class="py-name"><a title="papyros.distributed.NAME_SERVER_LOCATOR" class="py-name" href="#" onclick="return doclink('link-78', 'NAME_SERVER_LOCATOR', 'link-10');">NAME_SERVER_LOCATOR</a></tt> <tt class="py-op">=</tt> <tt class="py-name">Pyro</tt><tt class="py-op">.</tt><tt class="py-name">naming</tt><tt class="py-op">.</tt><tt class="py-name">NameServerLocator</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L247"></a><tt class="py-lineno">247</tt>  <tt class="py-line">        <tt id="link-79" class="py-name"><a title="papyros.distributed.PYRO_DAEMON" class="py-name" href="#" onclick="return doclink('link-79', 'PYRO_DAEMON', 'link-8');">PYRO_DAEMON</a></tt><tt class="py-op">.</tt><tt class="py-name">useNameServer</tt><tt class="py-op">(</tt><tt id="link-80" class="py-name"><a title="papyros.distributed.NAME_SERVER_LOCATOR" class="py-name" href="#" onclick="return doclink('link-80', 'NAME_SERVER_LOCATOR', 'link-10');">NAME_SERVER_LOCATOR</a></tt><tt class="py-op">.</tt><tt class="py-name">getNS</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L248"></a><tt class="py-lineno">248</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >papyros documentation</th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0beta1 on Tue Aug 12 05:39:45 2008
    </td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
